package com.ty.thymeleaf.entity;

import com.baomidou.mybatisplus.annotation.TableName;


import java.io.Serializable;
import java.util.Set;

/**
 * Role
 *
 * @aurhor Administrator  whs
 * @since 2024/8/30
 */
@TableName("sys_role")
public class Role implements Serializable {

    private Long roleId;  // 编号
    private String roleName; // 角色名称
    private String roleDesc; // 角色描述
    private Integer roleFlag; // 状态

    // 双向一对多关联
//    @OneToMany(targetEntity = User.class , fetch = FetchType.LAZY , cascade = CascadeType.REMOVE , mappedBy = "role")
//    private Set<User> users = new HashSet<User>();


    public Role() {
    }


    public Role(String roleName, String roleDesc, Integer roleFlag, Set<User> users) {
        this.roleName = roleName;
        this.roleDesc = roleDesc;
        this.roleFlag = roleFlag;
//        this.users = users;
    }

    public Role(Integer roleFlag, String roleDesc, String roleName) {
        this.roleFlag = roleFlag;
        this.roleDesc = roleDesc;
        this.roleName = roleName;
    }

    @Override
    public String toString() {
        return "Role{" +
                "roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                ", roleDesc='" + roleDesc + '\'' +
                ", roleFlag=" + roleFlag +
//                ", users=" + users +
                '}';
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleDesc() {
        return roleDesc;
    }

    public void setRoleDesc(String roleDesc) {
        this.roleDesc = roleDesc;
    }

    public Integer getRoleFlag() {
        return roleFlag;
    }

    public void setRoleFlag(Integer roleFlag) {
        this.roleFlag = roleFlag;
    }

//    public Set<User> getUsers() {
//        return users;
//    }
//
//    public void setUsers(Set<User> users) {
//        this.users = users;
//    }
}
